<!DOCTYPE html>
<html lang="ru" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Show</title>
</head>
<body>

<p th:text="${book.getTitle() + ', ' + book.getAuthor() + ', ' + book.getYear()}">VALUE</p>

<div>

    <div th:if="${people != null}">
        <p th:text="${'Эта книга свободна. Кому назначить ее?'}">TEXT</p>
        <form th:action="@{/books/{id}/assign(id=${book.getId()})}" th:method="PATCH">
            <label for="person">Выберите человека</label>
            <select id="person" th:field="*{id}" th:object="${anotherPerson}">
                <option th:each="person : ${people}" th:text="${person.getName()}"
                        th:value="${person.getId()}"></option>
            </select>
            <button type="submit">Назначить книгу</button>
        </form>
    </div>

    <div th:if="${person != null}">
        <p th:text="${'Книга сейчас у: ' + person.getName()}">TEXT</p>
        <form th:action="@{/books/{id}/release(id=${book.getId()})}" th:method="PATCH">
            <button type="submit">Освободить книгу</button>
        </form>
    </div>
</div>

<hr>

<form th:action="@{/books/{id}/edit(id=${book.getId()})}" th:method="GET">
    <button type="submit">Редактировать</button>
</form>

<form th:action="@{/books/{id}(id=${book.getId()})}" th:method="DELETE">
    <button type="submit">Удалить</button>
</form>

</body>
</html>